#include <iostream>
using namespace std;
const int N=10010;
int h[N],w[N];
int n=0,k=0;
bool check(int e)
{
    int res=0;
    for(int i=0;i<n;i++)
    {
        res+=(h[i]/e)*(w[i]/e);
        if(res>=k)return true;
    }
    return false;
}
int main()
{
    cin>>n>>k;
    for(int i=0;i<n;i++)
    {
        cin>>h[i]>>w[i];
    }
    int l=1,r=1e5;
    while(l<r)
    {
        int mid=l+r+1>>1;
        if(check(mid))l=mid;
        else r=mid-1;
    }
    printf("%d",l);
    return 0;
}